package org.dlx.drpc.simple;

import org.dlx.drpc.common.ExpRequest;
import org.dlx.drpc.common.ExpRequestHandler;
import org.dlx.drpc.common.JsonDecoder;
import org.dlx.drpc.common.JsonEncoder;
import org.dlx.drpc.core.server.RPCServer;

public class DemoServer
{
    public static void main(String[] args) {
        RPCServer server = new RPCServer("127.0.0.1", 8080, 1,2, 60,new JsonEncoder(), new JsonDecoder());
        server.register(ExpRequest.class, new ExpRequestHandler());
        try{
            server.start();
            server.working();
        }catch (Exception e)
        {
            e.printStackTrace();
        }finally
        {
            server.close();
        }
    }
}
